<?php
  // return player's map and location so they can load propper map
  require_once dirname(__FILE__)."/../purin2/core/core.php";
  require_once dirname(__FILE__)."/../purin2/xtr/xtr.php";
  require_once dirname(__FILE__)."/../purin2/user/session.php";
  
  puXtrBegin("Return player's map and location so they can load propper map");
  puXtrInputs();
  puXtrOutputs(
    'i_tmap',      'integer',  'map where avatar is',
    'v_name',      'string',   'map name',
    'v_filename',  'string',   'map XML file name',
    'i_x',         'integer',  'location on map where avatar is',
    'i_y',         'integer',  'location on map where avatar is'
  );

  // get input parameters
  $j_user = $pu_user_serial_no_csrf;
  if ($j_user <= 0)
    puXtrDie(1,'You must be logged in to read players map position!');

  // send me map where I am, or map 1 if im first time on server
  $sql = "select i_tmap, v_name, v_filename, i_x, i_y from asta, tmap where i_tmap=j_tmap and j_user=$j_user";
  puXtrRowsSql($sql,2);
  puXtrEnd(0,'Successfull');
?>